home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / graphics / 3dvect30.arj / QB.ARJ / MROOTS.BAS < prev    next >
BASIC Source File  |  1993-05-08  |  789b  |  47 lines

  1. a$ = "0123456789ABCDEF"
  2. w$ = "        db  "
  3. s$ = "roots   db  "
  4.  
  5. REM use: qbasic mroots.bas>roots.inc  to dump to disk
  6.  
  7. c = 0
  8. PRINT "; square root tables: 256 entries return root of 0-65535."
  9. PRINT "; in square root functions, high byte is only factor!"
  10. PRINT
  11. PRINT "; mov al,ah"
  12. PRINT "; mov ah,0"
  13. PRINT "; mov si,ax"
  14. PRINT "; mov ax,[roots+si]"
  15. PRINT : PRINT s$;
  16.  
  17. FOR z = 0 TO 255
  18.  
  19.  x = INT(SQR(z * 256) + .5)
  20.  
  21.  IF x = 256 THEN PRINT "00100h"; : GOTO 78
  22.  
  23.  q$ = "0"
  24.  
  25.  y = INT(x / 16)
  26.  
  27.  PRINT q$; MID$(a$, y + 1, 1); MID$(a$, (x / 16 - INT(x / 16)) * 16 + 1, 1); "h";
  28.  
  29. 78
  30.  
  31.  c = c + 1
  32.  IF c < 8 THEN PRINT ","; : GOTO 91
  33.  
  34.  c = 0
  35.  q = (z - 7) * 256
  36.  u = INT(q * 1000) / 1000
  37.  
  38.  PRINT " ;"; u
  39.  IF z = 255 THEN GOTO 91
  40.  
  41.  PRINT ; w$;
  42.  
  43. 91
  44.  
  45.  NEXT z
  46.  
  47.